home *** CD-ROM | disk | FTP | other *** search
/ Windows Game Programming for Dummies (2nd Edition) / WinGamProgFD.iso / mac / DirectX SDK / DXSDK / samples / Multimedia / VBSamples / DirectPlay / Memory / frmIntro.frm next >
Text File  |  2001-10-08  |  3KB  |  99 lines

  1. VERSION 5.00
  2. Begin VB.Form frmIntro 
  3.    BorderStyle     =   3  'Fixed Dialog
  4.    Caption         =   "VB Memory - A DirectPlay Sample"
  5.    ClientHeight    =   1515
  6.    ClientLeft      =   45
  7.    ClientTop       =   330
  8.    ClientWidth     =   2745
  9.    Icon            =   "frmIntro.frx":0000
  10.    LinkTopic       =   "Form1"
  11.    MaxButton       =   0   'False
  12.    MinButton       =   0   'False
  13.    ScaleHeight     =   1515
  14.    ScaleWidth      =   2745
  15.    StartUpPosition =   3  'Windows Default
  16.    Begin VB.CommandButton cmdSingle 
  17.       Caption         =   "Solitaire"
  18.       Height          =   375
  19.       Left            =   315
  20.       TabIndex        =   2
  21.       Top             =   1020
  22.       Width           =   975
  23.    End
  24.    Begin VB.CommandButton cmdMulti 
  25.       Caption         =   "Multiplayer"
  26.       Default         =   -1  'True
  27.       Height          =   375
  28.       Left            =   1455
  29.       TabIndex        =   0
  30.       Top             =   1020
  31.       Width           =   975
  32.    End
  33.    Begin VB.Label lbl 
  34.       BackStyle       =   0  'Transparent
  35.       Caption         =   "This sample will show a developer a simplistic game (Memory).  Please choose how you would like to play this game."
  36.       Height          =   1035
  37.       Left            =   60
  38.       TabIndex        =   1
  39.       Top             =   60
  40.       Width           =   2475
  41.    End
  42. End
  43. Attribute VB_Name = "frmIntro"
  44. Attribute VB_GlobalNameSpace = False
  45. Attribute VB_Creatable = False
  46. Attribute VB_PredeclaredId = True
  47. Attribute VB_Exposed = False
  48. Option Explicit
  49. '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  50. '
  51. '  Copyright (C) 1999-2001 Microsoft Corporation.  All Rights Reserved.
  52. '
  53. '  File:       frmIntro.frm
  54. '
  55. '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  56.  
  57. Private Sub cmdMulti_Click()
  58.  
  59.     Dim StagingArea As New frmStage
  60.     'Oh good, we want to play a multiplayer game.
  61.     'First lets get the dplay connection started
  62.     
  63.     'Here we will init our DPlay objects
  64.     InitDPlay
  65.     Set DPlayEventsForm = New DPlayConnect
  66.     Load StagingArea
  67.     EnableButtons False
  68.     'We only want to have a maximum of 4 players
  69.     If Not DPlayEventsForm.StartConnectWizard(dx, dpp, AppGuid, 4, StagingArea) Then
  70.         Cleanup
  71.         EnableButtons True
  72.     Else 'We did choose to play a game
  73.         gsUserName = DPlayEventsForm.UserName
  74.         Me.Hide
  75.         StagingArea.Show vbModeless
  76.         gfHost = DPlayEventsForm.IsHost
  77.     End If
  78.     
  79. End Sub
  80.  
  81. Private Sub cmdSingle_Click()
  82.     'We don't want to use DPlay, close down our objects
  83.     Cleanup
  84.     gbNumPlayers = 1
  85.     EnableButtons False
  86.     Me.Hide
  87.     frmGameBoard.Show
  88. End Sub
  89.  
  90. Private Sub Form_Unload(Cancel As Integer)
  91.     Cleanup
  92.     End
  93. End Sub
  94.  
  95. Public Sub EnableButtons(ByVal fEnable As Boolean)
  96.     cmdMulti.Enabled = fEnable
  97.     cmdSingle.Enabled = fEnable
  98. End Sub
  99.